<template>
	<view class="content">
		<image src="https://cdn.uviewui.com/uview/swiper/swiper1.png" class="spikes-image" mode=""></image>
		<view class="spikes-content">
			<view class="conatent-box" v-for="(item,index) in spiketimeData" :key="index" @click="spikes(index)">
				<view class="spikes-time" :class="state == index? 'spikex-time' : '' ">{{ item.time }}</view>
				<view class="spikes-come" :class="state == index?'come':''">{{ item.activity }}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 限时秒杀状态值
				state:'0',
				// 超值秒杀数据
				spiketimeData: [{
						time: '09:00',
						activity:'已结束'
					},
					{
						time: '13:00',
						activity:'抢购中'
					},
				],
			}
		},
		methods: {
			// 超值秒杀迪纳基亮高
			spikes(index) {
				this.state = index
			},
		}
	}
</script>

<style lang="scss" scoped>
	.content{
		width: 100%;
	}
	
	.spikes-image{
		width: 100%;
		height: 400rpx;
	}

	.spikes-content {
		height: 120rpx;
		font-size: 40rpx;
		// padding: 20rpx 20rpx 20rpx 20rpx;
		display: flex;
		margin-left: 5%;
	}
	
	.conatent-box {
		margin-right: 80rpx;
	}
	
	.spikex-time {
		color: red;
		text-align: center;
	}
	
	.spikes-time{
		width: 150rpx;
		text-align: center;
	}
	
	.spikes-come {
		color: #ccc;
		text-align: center;
	}
	
	.come {
		background-color: red;
		border-radius: 30rpx;
		color: white;
		width: 150rpx;
		text-align: center;
	}
</style>
